package com.relytosoft.mizar.analyze.structure.services.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.relytosoft.dubhe.common.core.base.page.PageQuery;
import com.relytosoft.mizar.analyze.base.entity.pojo.dto.TaskRequestDto;
import com.relytosoft.mizar.analyze.structure.api.entity.AyStructureTask;
import com.relytosoft.mizar.analyze.structure.api.entity.AyStructureTaskSon;
import com.relytosoft.mizar.analyze.structure.api.pojo.dto.AyStructureTaskDto;
import com.relytosoft.mizar.analyze.structure.api.pojo.dto.AyStructureTaskUpdateDto;
import com.relytosoft.mizar.analyze.structure.api.pojo.dto.AyTaskIdDto;
import com.relytosoft.mizar.analyze.structure.api.pojo.query.AyStruMotorVehicleSearchQuery;
import com.relytosoft.mizar.analyze.structure.api.pojo.query.AyStruNonMotorVehicleSearchQuery;
import com.relytosoft.mizar.analyze.structure.api.pojo.query.AyStructurePersonSearchQuery;
import com.relytosoft.mizar.analyze.structure.api.pojo.query.AyStructureTaskQuery;
import com.relytosoft.mizar.analyze.structure.api.pojo.vo.AyBatchVo;
import com.relytosoft.mizar.analyze.structure.api.pojo.vo.AyStructureTaskVo;

import java.util.List;

/**
 * @Author: zyc
 * @version: v1.0
 * @description: com.relytosoft.mizar.analyze.structure.services.service
 * @Date: 2022/5/12 15:42
 */
public interface AyStructureTaskService extends IService<AyStructureTask> {

    /**
     * 分页查询结构化分析主任务列表
     *
     * @param pageQuery
     * @param ayStructureTaskQuery
     * @return
     */
    IPage<AyStructureTaskVo> selectAyStructureTaskPageList(PageQuery pageQuery, AyStructureTaskQuery ayStructureTaskQuery);

    /**
     * 修改结构化分析主任务
     */
    boolean updateAyStructureTask(AyStructureTaskUpdateDto ayStructureTaskVo);


    /**
     * 添加主任务的同时添加子任务
     *
     * @param
     */
    List<TaskRequestDto> insertTaskWithSonWith(AyStructureTaskDto ayStructureTaskDto, AyStructureTask ayStructureTask);

    /**
     * 启动结构化分析任务
     *
     * @param
     */
    List<TaskRequestDto> startAyStructureTask(AyTaskIdDto ayAyTaskIdDto, AyStructureTask ayStructureTask, List<AyStructureTaskSon> ayStructureTaskSons);

    /**
     * 停止结构化分析任务
     *
     * @param
     */
    List<String> stopAyStructureTask(AyTaskIdDto ayAyTaskIdDto, AyStructureTask ayStructureTask, List<AyStructureTaskSon> ayStructureTaskSons);


    /**
     * 删除结构化分析任务
     *
     * @param
     */
    void deleteTaskWithSonWith(AyTaskIdDto ayTaskIdDto);


    /**
     * 结构化任务结果行人检索
     */
    JSONObject personResultSearch(AyStructurePersonSearchQuery structurePersonSearchQuery, PageQuery pageQuery);

    /**
     * 结构化任务结果机动车检索
     */
    JSONObject motorVehicleResultSearch(AyStruMotorVehicleSearchQuery ayStruMotorVehicleSearchQuery, PageQuery pageQuery);

    /**
     * 结构化任务结果非机动车检索
     */
    JSONObject nonMotorVehicleResultSearch(AyStruNonMotorVehicleSearchQuery ayStruNonMotorVehicleSearchQuery, PageQuery pageQuery);

    /**
     * 添加主任务通过dto
     *
     * @param ayStructureTaskDto
     * @return
     */
    AyBatchVo insertTaskByDto(AyStructureTaskDto ayStructureTaskDto);

    /**
     * 删除任务通过任务id集合
     *
     * @param ayTaskIdDto
     * @return
     */
    Boolean deleteTaskByIds(AyTaskIdDto ayTaskIdDto);

    /**
     * 批量开始任务
     *
     * @param ayTaskIdDto
     * @return
     */
    Boolean startTaskByIds(AyTaskIdDto ayTaskIdDto);

    /**
     * 批量结束任务
     *
     * @param ayTaskIdDto
     * @return
     */
    Boolean stopTaskByIds(AyTaskIdDto ayTaskIdDto);

    /**
     * 综合检索
     *
     * @param ayStruNonMotorVehicleSearchQuery
     * @param pageQuery
     * @return
     */
    JSONObject integratedSearch(AyStruNonMotorVehicleSearchQuery ayStruNonMotorVehicleSearchQuery, PageQuery pageQuery);
}
